-
Notifications
You must be signed in to change notification settings - Fork 87
[Server] refactor: registry loader #111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
chr-hertel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @soyuka - happy to see you here! :)
I think this PR makes a lot of sense and sorts some issues we saw already, thanks for that! Only minor comments from my end - didn't give it a test tho.
da9ab91 to
86e74b6
Compare
86e74b6 to
31428fb
Compare
|
my bad forgot to self-review I've also removed the |
chr-hertel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one - thanks @soyuka!
Refactor capability registration in Server Builder using dedicated loaders. A solution for #74
Motivation and Context
The previous
Server/Builder.phpcontained extensive logic for registering capabilities (tools, resources, prompts) both manually and through discovery. This led to a large and less modularBuilderclass. This change aims to improve the architecture by introducing dedicated loader classes for capability registration.How Has This Been Tested?
Existing tests for server capabilities and discovery should cover the functionality. No new tests were added as this is a refactoring. Let me know if I should add some as I'm not sure this is going to be accepted I didn't wanted to put unnecessary energy into unit testing.
Breaking Changes
No breaking changes are expected as this is an internal refactoring. The public API of the
Server/Builderremains the same.Types of changes
Checklist
Additional context
This refactoring extracts the capability registration logic into
ArrayRegistryLoaderfor manual registrations andDiscoveryRegistryLoaderfor discovery-based registrations. Both implementRegistryLoaderInterface. TheServer/Buildernow orchestrates these loaders, leading to a more extensible design.